package ner;

import java.util.List;
import java.util.Map;

public class CharacterDetailsCollector {
	
	
	
	public void findPositivesAndNegatives(ExtractionTask extractionTask){
		
		Map<Integer, List<BookCharacter>> sentencesWithCharacters=extractionTask.getSentencesWithCharacters();
//		System.out.println(commonSentences.size());

		for(BookCharacter bch:extractionTask.getCharacters()){
			
			
			for(Integer i:bch.getSentencesNumbers()){
				
	//			if(!commonSentences.containsKey(i)){
					
					for(String baseWord:extractionTask.getBaseWords().get(i)){	//TODO  stop after first found?
						if(Knowledge.postiveWords.contains(baseWord)){
							bch.getPositiveSentences().add(i);
							System.out.println("POSITIVE!\n\n");
						}
						if(Knowledge.negativeWords.contains(baseWord)){
							bch.getNegativeSentences().add(i);				
							System.out.println("NEGATIVE\n\n!");
						}
						
		//			}
					
				}
			
				
				
			}
		
		}		
	}
	
	

	
	
	

}
